﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Chinaer.Dao
{
    public class CountryDAO : Repository, IDao.ICountryDAO
    {
        private IDao.ICountryDAO countryDAO = new Dao.EF.CountryDAO();
        public bool EnableTrack
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public IList<Model.Entities.Model_Country> Query(string sql, int pageIndex, out int recordCount, int pageSize, params System.Data.SqlClient.SqlParameter[] sqlParams)
        {
            return countryDAO.Query(sql, pageIndex, out recordCount, pageSize, sqlParams);
        }

        public Model.Entities.Model_Country GetByID(string id)
        {
            return countryDAO.GetByID(id);
        }

        public bool Exists(string id)
        {
            return countryDAO.Exists(id);
        }

        public bool Add(Model.Entities.Model_Country entity)
        {
            return countryDAO.Add(entity);
        }

        public bool Update(Model.Entities.Model_Country entity)
        {
            return countryDAO.Update(entity);
        }

        public bool Delete(Model.Entities.Model_Country entity)
        {
            return countryDAO.Delete(entity);
        }

        public bool Delete(string id)
        {
            return countryDAO.Delete(id);
        }

        public int DeleteByIDs(IList<string> listID)
        {
            return countryDAO.DeleteByIDs(listID);
        }

        public List<Model.Entities.Model_Country> GetAllCountry()
        {
            return countryDAO.GetAllCountry();
        }


        public Model.Entities.Model_Country GetByCode(string code)
        {
            return countryDAO.GetByCode(code);
        }

        public Model.Entities.Model_Country GetByName(string name)
        {
            return countryDAO.GetByName(name);
        }
    }
}
